<%--
  Created by IntelliJ IDEA.
  User: xiaoziyan
  Date: 2022/4/26
  Time: 17:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>数据可视化</title>

    <link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon">

    <!-- 1. 导入CSS的全局样式 -->
    <link href="${pageContext.request.contextPath}/css/bootstrap.css" rel="stylesheet">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <!-- 2. jQuery导入，建议使用1.9以上的版本 -->
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.js"></script>
    <!-- 3. 导入bootstrap的js文件 -->
    <script src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
    <script src="${pageContext.request.contextPath}/layui/layui.js" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/js/echarts.min.js" charset="utf-8"></script>
</head>


<style>
    .edit_content {
        margin-top: 20px;
        display: flex;
        justify-content: center;
    }
    .edit_content button{
        width: 30%;
        height: 30px;
        border: 2px solid #909399;
        border-radius: 5px;
        background-color: #4cae4c;
    }
    .edit_content button a {
        color: white;
        text-decoration:none;
    }
    .edit_content button:hover {
        opacity: 0.5;
    }
</style>
<body>
<!-- 为 ECharts 准备一个定义了宽高的 DOM -->


<h1 style="text-align: center;margin-bottom: 15px;font-size: 24px;font-weight: bold">节点数据可视化</h1>
<form class="form-inline" style="text-align: center">
    <div class="form-group" >
        <label style="color: #0f0f0f">IMEI号：</label>
        <!--<input type="text" class="form-control" id="exampleInputName2" placeholder="2022/12/12">-->
        <label style="text-decoration: underline">${node.IMEI}</label>
    </div>
    <div class="form-group"style="margin-left: 30px">
        <label style="color: #0f0f0f">所属项目：</label>
        <!--<input type="email" class="form-control" id="exampleInputEmail2" placeholder="一号员工">-->
        <label style="text-decoration: underline">${node.project_name}</label>
    </div>
    <div class="form-group"style="margin-left: 30px">
        <label style="color: #0f0f0f">项目地址：</label>
        <!--<input type="email" class="form-control" id="exampleInputEmail2" placeholder="一号员工">-->
        <label style="text-decoration: underline">${node.project_location}</label>
    </div>
    <div class="form-group"style="margin-left: 30px">
        <label style="color: #0f0f0f">节点地址：</label>
        <!--<input type="email" class="form-control" id="exampleInputEmail2" placeholder="一号员工">-->
        <label style="text-decoration: underline">${node.node_location}</label>
    </div>
</form>

<div id="main" style="width: 100%;height:520px;"></div>

<div class="edit_content">
    <button ><a href="${pageContext.request.contextPath}/nodeViewServlet">返回节点列表</a></button>
</div>
<script type="text/javascript">

    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option;

    option = {

        xAxis: {
            type: 'category',
            data: ${time}
        },
        yAxis: {
            type: 'value',
            /*max:10,*/
            minInterval: 0
        },
        series: [
            {
                data: ${data},   /*[1, 2, 1, 0, 3, 1, 1]*/
                type: 'line',
                smooth: true,
                label: {
                    show: true,
                    position: 'top',
                    textStyle: {
                        fontSize: 20
                    }
                }
            }
        ]
    };

    option && myChart.setOption(option);
</script>
</body>


</html>
